package com.example.springbootfirst.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.Date;

/**
 * created by Morgan on 2021/10/1
 */
@MappedSuperclass
@Data
@ApiModel("基类-各实体类的父类")
public class BaseEntity {
    @Id
    @GenericGenerator(name="jpa-uuid",strategy = "com.example.springbootfirst.entity.JpaUuidGenerator")
    @GeneratedValue(generator = "jpa-uuid")
    @Column(name = "id",length = 64,updatable = false,nullable = false)
    @ApiModelProperty("主键id")
    private String id;
    @ApiModelProperty("创建人")
    private String createdBy;
    @ApiModelProperty("创建日期")
    private Date createdDate;
    @ApiModelProperty("最后修改人")
    private String modifiedBy;
    @ApiModelProperty("最后修改日期")
    private Date modifiedDate;
    @ApiModelProperty("删除标识（0：未删除 1：已删除 逻辑删除用）")
    private int deleted;
    @ApiModelProperty("当前版本(实现乐观锁用)")
    private int version;

}
